package com.qf.smsplatform.interfaces.client;

import oracle.jrockit.jfr.StringConstantPool;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 映射缓存模块的Client接口
 * @author zjw
 */
@FeignClient(value = "sms-platform-cache")
public interface CacheClient {

    /**
     *  通过key获取hash结构中的所有field和value封装成map返回
     * @param key
     * @return
     */
    @RequestMapping(value = "/cache/hmget/{key}", method = RequestMethod.GET)
    public Map hGetAll(@PathVariable("key") String key);

    /**
     * 根据key和field查询hash结构中的value
     * @param key    redis的key
     * @param field  redis的hashKey
     * @return
     */
    @GetMapping("/cache/hget/{key}")
    public String hget(@PathVariable String key, @RequestParam String field);
}
